/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.colswedev.app.labhudson.control;

import javax.swing.JOptionPane;
import org.colswedev.app.labhudson.entity.Customer;

/**
 *
 * @author Leonardo Bohórquez
 */
public class AuthControl {

    public boolean Login(String username, String password) {
	CustomerControl cc = CustomerControl.getInstance();
	Customer c = cc.read(new Customer(username));
	if (c != null) {
	    if (!c.getUserName().equals(username) || !c.getPassword().equals(password)) {
		return false;
	    }
	} else {
	    return false;
	}
	TransactionControl.getInstance().setCustomer(c);
	return true;
    }
}
